package net.northcoding.fresh.util;
// @Author Diamond - Administrator
// @Date 2023/12/8 13:20:15

import net.northcoding.fresh.exception.TODOException;

import java.io.IOException;

public class TODO {
    private static final Logger logger = new Logger("TODO", "D:\\code\\Java\\others\\Fresh\\code\\output.log");

    public static void coreTODO(String clazz, String method, String msg) throws IOException {
        logger.error(
                String.format("There is something to do with %s.%s:%s",
                        ConsoleUtil.getColoredString(ConsoleUtil.color.CYAN, false, ConsoleUtil.font.BOLD, clazz),
                        method, msg
                )
        );
        System.err.println("There is something important to do with " + clazz + "." + method);
        throw new TODOException();
    }

    public static void otherTODO(String clazz, String method, String msg) throws IOException {
        logger.warn(
                String.format("There is something to do with %s.%s:%s",
                        ConsoleUtil.getColoredString(ConsoleUtil.color.CYAN, false, ConsoleUtil.font.BOLD, clazz),
                        method, msg
                )
        );
    }

    public static void coreTODO(Class<?> clazz, String method, String msg) throws IOException {
        coreTODO(clazz.getName(), method, msg);
    }

    public static void otherTODO(Class<?> clazz, String method, String msg) throws IOException {
        otherTODO(clazz.getName(), method, msg);
    }
}
